﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>会员等级</title>
	<meta charset="utf-8" />
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        .Main_Shop
         {
            width:100%;
            height:100%;
            background:rgb(224,224,224);
        }
    </style>
    <script src="../Scripts/jquery-1.7.1.js"></script>
    <script src="../Scripts/jquery.min.js"></script>
    <script src="../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $().ready(function () {
            $('#tbMLevel').datagrid({
                fitColumns:true,
                url: '../jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
                method: "get",
                toolbat: "#db",
                pagination: true,
                rownumbers: true,
                singleSelect:true,
                columns: [[
                    { field: 'code', title: '等级编号', width: 100 },
                    { field: 'name', title: '登记名称', width: 100 },
                    { field: 'price', title: '所需最大积分', width: 100 },
                    { field: 'name', title: '扣分比例', width: 100 },
                    { field: 'price', title: '折扣比例', width: 100 }
                ]]
            });
            //新增
            $("#btnLevelAdd").click(function () {
                $("#dlg").dialog({ width: 600, height: 400, left: 400, top: 0 })
                .dialog("setTitle", "新增会员卡类别")
                .dialog("open");
                $("#frm1").attr("src","AddMemberType.html");
            });
            //修改
            $("#btnLevelUpdate").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null)
                {
                    $("#dlg").dialog({ width: 600, height: 400, left: 400, top: 0 })
               .dialog("setTitle", "修改会员卡类别")
               .dialog("open");
                    $("#frm1").attr("src", "AddMemberType.html");
                }
                else
                {
                    alert('请先选择所需修改的会员等级信息');
                }
            });
            //删除
            $("#btnLevelDel").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null) {
                    if (confirm('确定要删除此会员等级吗？'))
                    { }
                }
                else {
                    alert('请选择所需删除的会员等级');
                }
            });
        });
    </script>
</head>
<body>
    <div class="Main_Shop">
        <!-- 按钮 -->
        <div id="db">
            <a id="btnLevelAdd" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>  
            <a id="btnLevelUpdate" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>  
            <a id="btnLevelDel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>  
        </div>
        <!--查询  -->
        <div>
            <label for="name">等级名称:</label>
            <input class="easyui-textbox" type="text" name="txtshopLevelName"></input>
            <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>  
        </div>
        <div id="dlg" class="easyui-dialog" data-options="closed:true" style="margin-top:0px;overflow:hidden; ">
            <iframe id="frm1" width="100%" height="99%" frameborder="0"></iframe>
        </div>
        <table id="tbMLevel"></table>
    </div>
</body>
</html>
